home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 353_02 / tryndate.cpp < prev    next >
C/C++ Source or Header  |  1992-01-18  |  527b  |  23 lines

  1.                                     // Chapter 7 - Program 11
  2. #include <iostream.h>
  3. #include "newdate.h"
  4.  
  5. void main(void)
  6. {
  7. new_date now, later, birthday;
  8.  
  9.    later.set_date(12, 31, 1991);
  10.    birthday.set_date(2, 19, 1991);
  11.  
  12.    cout << "Today is day " << now.get_day_of_year() << "\n";
  13.    cout << "Dec 31 is day " << later.get_day_of_year() << "\n";
  14.    cout << "Feb 19 is day " << birthday.get_day_of_year() << "\n";
  15. }
  16.  
  17.  
  18. // Result of execution
  19.  
  20. // Today is day 20
  21. // Dec 31 is day 365
  22. // Feb 19 is day 50
  23.